//工具函数
import { Dimensions } from 'react-native';
import { BED_URL } from '../utils/config';

/**
 * 获取设备屏幕宽高的对象
 * screenSize = {
 *   width,
 *   height
 * }
 */
const screenSize = {
  width: Dimensions.get('window').width,
  height: Dimensions.get('window').height
}

/**
 * gitee图片显示失败转七牛
 * http://r9fvrlt6a.hn-bkt.clouddn.com/image-20210318200356644.png
 * @param {*} url 
 * @returns 
 */
function imgUrlReplace(url) {
  return url.replace(BED_URL.GITEE, BED_URL.QINIU);
}

export {
  screenSize,
  imgUrlReplace
}

